package com.jsbs.iam.job.dyncjob.factory;

import com.jsbs.iam.job.dyncjob.task.base.BaseTask;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
public class DyncJobFactory {

    private Map<String, BaseTask> map = new HashMap<>();

    public void register(String jobName, BaseTask task){
        map.put(jobName, task);
    }

    public BaseTask getTask(String jobName){
        return map.get(jobName);
    }
}
